package com.weilan.ark3.buffer;

import com.weilan.ark3.entity.ConfigDto;
import com.weilan.ark3.entity.ControlRtu;
import com.weilan.ark3.sqlite.SQLiteConfigUtils;
import org.springframework.stereotype.Component;

import java.util.*;

@Component
/*
 * 进行系统参数初始化
 * */
public class OverallSituation {

    public static HashMap<String, String> CacheData = new HashMap<>();

//    public static HashMap<Integer,short[]> slaveData = new HashMap<>();

    public static Set<Integer> slaveSet = new HashSet();

    public static List<ControlRtu> com1MessgeRank1 = new ArrayList<>();
    public static List<ControlRtu> com1MessgeRank2 = new ArrayList<>();

    public static List<ControlRtu> tcpMessgeRank1 = new ArrayList<>();
    public static List<ControlRtu> tcpMessgeRank2 = new ArrayList<>();


    //获取配置表
    public static ConfigDto configDto = SQLiteConfigUtils.query();
    public static int arkDeviceNumber = configDto.getArkDeviceNumber();
    //com1口是否需要打开
    public static Integer com1State = configDto.getCom1State();
    //com2口是否需要打开
    public static Integer com2State = configDto.getCom2State();
    //com3口是否需要打开
    public static Integer com3State = configDto.getCom3State();

    //TCP口是否需要打开
    public static Integer tcpState = configDto.getTcpState();
    public static Integer tcpSlaveStartId = configDto.getTcpSlaveStartId();
    public static Integer ucStartId = configDto.getUcStartId();

    public static Integer tcpMasterStartId = configDto.getTcpMasterStartId();
    public static Integer controlId = configDto.getControlId();
    public static Integer acuStartId = configDto.getAcuStartId();
    public static Integer acuDeviceNumber = configDto.getCollectingTankNumber();

    public static short[] OverallEMSData;
    public static short[] shorts;

    //时间格式
    public final static String pattern = configDto.getPattern();

    //时区
    public static String GMT = configDto.getTimezone();

    //是否有acu
    public static Integer ACU = configDto.getAcuState();

    //初始化数据保存时间
    //public static Integer SaveTime = configDto.getSaveTime();

}
